package com.sgb.goods.view.adapter;

import android.content.Context;
import android.widget.TextView;

import androidx.databinding.ViewDataBinding;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.goods.R;
import com.sgb.goods.entity.AppointEntity;
import com.sgb.goods.utils.base.adapter.BaseCommonAdapter;

/**
 * 约定信息
 * @author cyj
 */
public class AppointInfoListAdapter extends BaseCommonAdapter<AppointEntity> {

    public AppointInfoListAdapter() {
        super(R.layout.goods_item_appoint);
    }

    @Override
    protected void convert(BaseViewHolder baseHolder, ViewDataBinding dataBinding, AppointEntity entity) {
        TextView textView = baseHolder.getView(R.id.title_name);
        textView.setText(entity.appointName);
        RecyclerView recyclerView = baseHolder.getView(R.id.recycle_view);
        AppointInfoTxtAdapter adapter = new AppointInfoTxtAdapter();
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
        recyclerView.setAdapter(adapter);
        adapter.setNewData(entity.fields);
    }
}
